<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.person.vo.Article"%>
<%@page import="com.person.pojo.ArticleInfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!-- 获取该文章的评论 -->
<c:if test="${sessionScope.CommFlag == null || sessionScope.CommFlag == 0 }">
	<jsp:forward page="/getComm" />
</c:if>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>${sessionScope.arti.title }</title>
    <link rel="stylesheet" href="/PersonalBlog/frontPages/css/index.css">
    <link rel="stylesheet" href="/PersonalBlog/frontPages/css/article.css">
</head>
<body>
    <header class="size-header">
        <div class="image"><a href="/PersonalBlog/frontPages/index.jsp"><img src="/PersonalBlog/frontPages/img/akina.png" alt=""></a></div>
        <div class="menu">
            <div class="Secret-Menu">
                <div class="ulbox">
                    <ul>
                        <li><a href="/PersonalBlog/frontPages/index.jsp">首页</a></li>
                        <li><a href="">分类</a></li>
                        <li><a href="">更多</a></li>
                    </ul>
                </div>
                <i class="iconfont iconhanbao"></i>
            </div>
            
            <div class="search">
                <i class="iconfont iconsearch"></i>
            </div>
            <div class="account">
                <i class="iconfont icon1"></i>
            </div>
        </div>
    </header>

    <div class="arti_mainText">
        <h1>${sessionScope.arti.title }</h1>
        <div class="issueDate"><span>发布日期：</span> <span>${sessionScope.arti.strDate }</span></div>
        <div class="artiContent">
        	${sessionScope.arti.content }
    	</div>
    </div>

<!-- 评论 -->
	    <div class="comment">

        <form action="/PersonalBlog/commAdd" method="post">
            <h2>添加新评论</h2>
            <div class="content">
                <textarea name="content" id="" cols="110" rows="8.5" placeholder="在这里输入评论..."></textarea>
            </div>
             <div class="personalInfo">
                <input type="text" name="name" placeholder="昵称*" value="${history.nickName }">
                <input type="text" name="email" placeholder="电子邮件*" value="${history.email }">
                <input type="text" name="website" placeholder="网站(非必须)" value="${history.website }">
            </div>
            <div class="sub">
                <input type="submit" value="发表评论" >
            </div>
        </form>

        
        <c:forEach items="${requestScope.commList }" var="comm">
        <div class="parentComment" id="${comm.commtentId }">
            <div class="info">
                <div class="headPort">
                    <!-- 头像 -->
                    <img src="/PersonalBlog/frontPages/img/timg.jpg" alt="头像">
                </div>
                <div class="nickname"><span>${comm.nickName }</span></div>
                <div class="content">
                    ${comm.commtentCont }
                </div>
                <div class="otherinfo">
                    <!-- 发言时间 -->
                    <div class="date">
                        ${comm.strDate }
                    </div>

                    <div class="praise">
                        <a href=""><i class="iconfont iconzan"></i></a> <span>${comm.praiseNum }</span>
                    </div>
                    <div class="reply"><span>回复</span></div>
                </div>

                <div class="children">
                    <div class="chilheadPort"><img src="/PersonalBlog/frontPages/img/timg.jpg" alt="头像"></div>
                    <div class="chilnickname">昵称昵称</div>
                    <div class="chilcontent"><span>内容Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi, odit!</span></div>
                    <div class="chilother">
                        <div class="date">2020-12-11 10:11:33:20</div>
                        <div class="praise">
                            <a href=""><i class="iconfont iconzan"></i></a> <span>123</span>
                        </div>
                        <div class="reply"><span>回复</span></div>
                    </div>
                </div>
            </div>
            <!-- 回复评论 -->
            <div class="replycomments">
                <!-- 内容 -->
                <form action="" method="post">
                    <!-- 头像 -->
                    <div class="replyheadp"><img src="/PersonalBlog/frontPages/img/timg.jpg" alt="头像"></div>
                    <!-- 隐形表单(父评论id) -->
                    <input type="hidden" name="parentId" />
                    <div class="replycontents"><textarea name="replycontents" id="" cols="30" rows="10" placeholder="回复"></textarea></div>
                    <input type="submit" value="发表评论">
                </form>
            </div>

        </div>
        </c:forEach>
    </div>

	<script>
		var parentComment = document.querySelector(".parentComment");
	</script>
    <script src="/PersonalBlog/frontPages/js/index.js"></script>
    <c:set var="CommFlag" value="0" scope="session"></c:set>
</body>
</html>
